<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

use App\Http\Controllers\api\LoginController;
use App\Http\Controllers\api\ImageController;
use App\Http\Controllers\api\HaggleController;
use App\Http\Controllers\api\PackGoodsController;
use App\Http\Controllers\api\HotListController;
use App\Http\Controllers\api\RushCouponController;

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
//微信登录接口
Route::get('wxLogin', [LoginController::class, 'wxLogin']);
//商品分类信息查询接口
Route::get('selectGoodsType', [\App\Http\Controllers\api\GoodsTypeController::class, 'selectGoodsType']);
//根据分类查询商品
Route::get('selectTypeGoods', [\App\Http\Controllers\api\GoodsTypeController::class, 'selectTypeGoods']);
//第三方发送短信验证码
Route::get('wxEnroll', [LoginController::class, 'wxEnroll']);
//手机号注册
Route::get('wxEnrollLogin', [LoginController::class, 'wxEnrollLogin']);
//手机号密码登录
Route::get('wxPhoneLogin', [LoginController::class, 'wxPhoneLogin']);
//用户修改密码
Route::get('wxForgetPassword', [LoginController::class, 'wxForgetPassword']);
//判断用户登录状态
Route::group(['middleware' => 'login'], function () {
    //用户修改密码
    Route::get('wxMyList', [LoginController::class, 'wxMyList']);
});
//文字审核
Route::get('textApi', [ImageController::class, 'textApi']);
//图片审核
Route::get('imageApi', [ImageController::class, 'imageApi']);
//商品评论查询接口
Route::get('commentGet', [\App\Http\Controllers\api\GoodsCommentController::class, 'selectComment']);
//添加评论接口
Route::get('insertComment', [\App\Http\Controllers\api\GoodsCommentController::class, 'insertComment']);
//砍价管理
Route::group(['namespace' => 'bargain'], function () {
    Route::get('bargain', [HaggleController::class, 'bargain']);
    Route::get('getBargainTime', [HaggleController::class, 'getBargainTime']);
    Route::get('bargainDetail', [HaggleController::class, 'bargainDetail']);
    Route::get('startBargian', [HaggleController::class, 'startBargian']);
    Route::get('bargainInvitation', [HaggleController::class, 'bargainInvitation']);
    Route::get('bargainRecord', [HaggleController::class, 'bargainRecord']);
    Route::get('helpCut', [HaggleController::class, 'helpCut']);
});
//搜索热榜
Route::group(['namespace' => 'hotlist'], function () {
    Route::get('searchHot', [HotListController::class, 'searchHot']);
});

//优惠券抢购
Route::group(['namespace' => 'rushcoupon'], function () {
    Route::get('rushBuy', [RushCouponController::class, 'rushBuy']);
});


Route::group([], function () {
    //优惠券相关接口
    Route::get('couponList', [\App\Http\Controllers\api\CouponController::class, 'couponList']);
    //兑换优惠券
    Route::get('exchangeCoupon', [\App\Http\Controllers\api\CouponController::class, 'exchangeCoupon']);
    //个人优惠券
    Route::get('userCoupon', [\App\Http\Controllers\api\CouponController::class, 'userCoupon']);
    //优惠券状态
    Route::get('couponStatus', [\App\Http\Controllers\api\CouponController::class, 'couponStatus']);
    //订单相关接口
    //创建订单接口
    Route::post('createOrder', [\App\Http\Controllers\api\OrderController::class, 'createOrder']);
    //订单列表
    Route::get('orderList', [\App\Http\Controllers\api\OrderController::class, 'orderList']);
    //订单详情
    Route::get('orderInfo', [\App\Http\Controllers\api\OrderController::class, 'orderInfo']);
    //订单标签
    Route::get('tabList', [\App\Http\Controllers\api\OrderController::class, 'tabList']);
    //支付订单
    Route::get('payOrder', [\App\Http\Controllers\api\PayController::class, 'payOrder']);
    //
    Route::get('payCallback', [\App\Http\Controllers\api\PayController::class, 'payCallback']);
    //支付方式
    Route::get('payList', [\App\Http\Controllers\api\OrderController::class, 'payList']);
    //购物车列表
    Route::get('cartList', [\App\Http\Controllers\api\CartController::class, 'cartList']);
    //商品详情
    Route::get('goodsInfo', [\App\Http\Controllers\api\GoodsController::class, 'goodsInfo']);
    //加入购物车
    Route::get('addCart', [\App\Http\Controllers\api\CartController::class, 'addCart']);

    //申请退款
    Route::get('refundPrice', [\App\Http\Controllers\api\PayController::class, 'refundPrice']);
});


Route::get('signIn', [\App\Http\Controllers\api\UserSignIn::class, 'signIn']);//冯保杰  用户签到接口
Route::get('mendSignIn', [\App\Http\Controllers\api\UserSignIn::class, 'mendSignIn']);//冯保杰 用户补签接口
Route::get('getUserSignList', [\App\Http\Controllers\api\UserSignIn::class, 'getUserSignList']);//冯保杰 获取用户所有签到信息接口
Route::get('SeckillDetail', [\App\Http\Controllers\api\seckill\SeckillController::class, 'SeckillDetail']);//冯保杰 秒杀详情接口
Route::get('getSecketList', [\App\Http\Controllers\api\seckill\SeckillController::class, 'getSecketList']);//冯保杰 秒杀列表接口
Route::get('BegainSeckill', [\App\Http\Controllers\api\seckill\SeckillController::class, 'BegainSeckill']);//冯保杰 秒杀接口
Route::get('seckillGoodsSearch', [\App\Http\Controllers\api\seckill\SeckillController::class, 'seckillGoodsSearch']);//冯保杰 秒杀接口
Route::get('orderDetail', [\App\Http\Controllers\api\OrderController::class, 'orderDetail']);//冯保杰 秒杀接口
Route::get('getUserCommunity', [\App\Http\Controllers\api\CommunityController::class, 'getUserCommunity']);//冯保杰 根据经纬度获取用户社区接口
Route::get('addShoppingCart', [\App\Http\Controllers\api\CommunityController::class, 'addShoppingCart']);//冯保杰 根据经纬度获取用户社区接口
Route::get('selectAddress', [\App\Http\Controllers\api\CommunityController::class, 'selectAddress']);//冯保杰 根据经纬度获取用户社区接口

//拼团列表页
Route::get('wxGroupBookingList', [PackGoodsController::class, 'wxGroupBookingList']);
//拼团详情页
Route::get('wxGroupBookingDetails', [PackGoodsController::class, 'wxGroupBookingDetails']);
//拼团商品详情页
Route::get('wxGoodsDetails', [PackGoodsController::class, 'wxGoodsDetails']);
//开启拼团
Route::get('wxGroupBookingAdd', [PackGoodsController::class, 'wxGroupBookingAdd']);
//加入别人的团
Route::get('wxGroupBookingAddition', [PackGoodsController::class, 'wxGroupBookingAddition']);

Route::get('commentInsert', [\App\Http\Controllers\api\GoodsCommentController::class, 'selectComment']);


/*
 *何家令收货地址增删改查
 *
 */
//查询地址列表信息
Route::get('getPlace', [\App\Http\Controllers\api\PlaceController::class, 'getPlace']);
//查询地址详情信息
Route::get('placeDetail', [\App\Http\Controllers\api\PlaceController::class, 'placeDetail']);
//地址添加接口
Route::get('addPlace', [\App\Http\Controllers\api\PlaceController::class, 'addPlace']);
//地址修改接口
Route::get('updatePlace', [\App\Http\Controllers\api\PlaceController::class, 'updatePlace']);
//删除地址
Route::get('delPlace', [\App\Http\Controllers\api\PlaceController::class, 'delPlace']);
Route::group([], function () {
    //查看所属门店所有的商品
    Route::get('shopGoods', [\App\Http\Controllers\api\ShopController::class, 'shopGoods']);
    //查看是否是团长,如果是团长直接将团长相关的门店和商品查出来
    Route::get('selectHead', [\App\Http\Controllers\api\ShopController::class, 'selectHead']);
    Route::get('delPlace', [\App\Http\Controllers\api\PlaceController::class, 'delPlace']);


    Route::group([], function () {
        //获取自提点位置
        Route::get('addAddress', [\App\Http\Controllers\api\GroupController::class, 'addAddress']);
        //团长端商品列表
        Route::get('goodsList', [\App\Http\Controllers\api\GroupController::class, 'goodsList']);
        //团长端商品详情
        Route::get('inFo', [\App\Http\Controllers\api\GroupController::class, 'inFo']);
        //团长订单详情
        Route::get('groupTab', [\App\Http\Controllers\api\GroupController::class, 'groupTab']);
        //拼团列表
        Route::get('groupOrderList', [\App\Http\Controllers\api\GroupController::class, 'groupOrderList']);
    });
});
